// dlibcall.cpp : Defines the entry point for the console application.
//


#include <cstdio>
#include <Windows.h>
#include <tchar.h>

#include "..\\dlib\\dlib.h"

typedef  int ( * lpFun)(int, int);

int main(int argc, char* argv[])
{
	HINSTANCE hdll;
	lpFun subfun;

	hdll = LoadLibrary(_T("dlib.dll"));
	if (hdll != NULL)
	{
		subfun = (lpFun) GetProcAddress(hdll,"substract");
		if (subfun != NULL)
		{
			
			printf("10 - 2 = %d ", subfun(10, 2));

			subfun = (lpFun)GetProcAddress(hdll, "multiply");
			printf("10 * 2 = %d ", subfun(10, 2));
		}
		FreeLibrary(hdll);
	}
	else
	{
		printf("can't find dlib.dll");
	}

	return 0;
}

